<template>
  <div>
    <table border="1" cellspacing="0">
      <tr>
        <td>名称</td>
        <td>时间</td>
        <td>图片</td>
      </tr>
      <tr v-if="j<=4" v-for="(i,j) in movie">
        <td>{{ i.name }}</td>
        <td>{{ i.mtime }}</td>
        <td>
          <router-link :to="{name:'show_my2',query:{'id':i.id}}"><img :src="'http://127.0.0.1:8000'+i.pic" alt=""
                                                                      width="100px"></router-link>
        </td>
      </tr>
    </table>

    <table>
      <tr>
        <td>姓名</td>
        <td>性别</td>
        <td>年龄</td>
      </tr>
      <tr v-for="k in yan">
        <td>{{ k.name }}</td>
        <td v-if="k.sex==1">男</td>
        <td v-else>女</td>
        <td>{{ k.age }}</td>

      </tr>

    </table>

  </div>
</template>

<script>
export default {
  name: "show_my",
  data() {
    return {
      movie: [],
      yan: []
    }
  },
  methods: {
    get_movie() {
      this.$axios.get('movie/')
        .then(res => {
          if (res.data.code == 200) {
            this.movie = res.data.list
          }
        })
    },
    get_yan() {
      this.$axios.get('yan/')
        .then(res => {
          this.yan = res.data.list
        })
    }

  },
  mounted() {
    this.get_movie()
    this.get_yan()
  }
}
</script>

<style scoped>

</style>
